<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	<jsp:include page="css/main.css"></jsp:include>
</style>
<script type="text/javascript">
	<jsp:include page="js/prototype.js"></jsp:include>
</script>
</head>
<body>

<div class="wrapper">

<div class="left-sidebar">

<p><a href="${scriptPath}">Trang chủ</a></p>

<c:if test="${sessionScope.login}">
Xin chào ${sessionScope.user.fullname}
</c:if>

<c:choose>
	<c:when test="${sessionScope.login}">
		<p><a href="?action=user.edituser" title="Edit User" target="_self">Edit User Infomation</a></p>
		<p><a href="?action=user.logout" title="Log Out" target="_self">Log Out</a> </p>
		<p><a href="?action=history.list" title="Xem lịch sử các bài kiểm tra đã làm" target="_self">Lịch sử</a> </p>
	</c:when>
	<c:otherwise>
		<p><a href="?action=user.login" title="Log In" target="_self">Log In</a> </p>
		<p><a href="?action=user.signup" title="Sign Up" target="_self">Sign Up</a></p>
		<p><a href="?action=user.forgetpass" title="Forget Pass" target="_self">Forget Password</a></p>
	</c:otherwise>
</c:choose>

<p><a href="${scriptPath}?action=test.list">Đề thi</a></p>
<p><a href="${scriptPath}?action=question.list">Câu hỏi</a></p>

<c:if test="${sessionScope.login && sessionScope.user.group=='admin'}">
<div>
	<jsp:include page="includes/modules/admin.jsp"></jsp:include>
</div>
</c:if>

</div>

<div class="main">
	<c:catch var="ex">
		<jsp:include page="includes/actions/${param.action}.jsp"></jsp:include>
	</c:catch>
	${ex}
</div>

</div>

</body>
</html>